import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule, Routes } from '@angular/router';
import { MaterializeModule } from "angular2-materialize";

import { LoadingComponent } from './loading/loading.component';
import { LoginComponent } from './login/login.component';
import { ToastComponent } from './toast/toast.component';
import { AppComponent } from './app.component';
import { HeadComponent } from './head/head.component';
import { ContentComponent } from './content/content.component';
import { ContentFromComponent } from './content-from/content-from.component';
import { ContentIndexComponent } from './content-index/content-index.component';
import { ContentAboutComponent } from './content-about/content-about.component';
import { FooterComponent } from './footer/footer.component';



import { ConfigService } from './config.service';
import { CookieService } from 'angular2-cookie/services/cookies.service';



//url hack 
import {HashLocationStrategy,LocationStrategy} from '@angular/common';

const routes: Routes = [
  { 
    path: 'index', component:ContentIndexComponent},
  {
    path: 'about',component:ContentAboutComponent
  },
  {
       path: '**', redirectTo: "index"
  }
];

@NgModule({
  declarations: [
    AppComponent,
    HeadComponent,
    ContentComponent,
    ContentFromComponent,
    ContentIndexComponent,
    ContentAboutComponent,
    FooterComponent,
    LoadingComponent,
    LoginComponent,
    ToastComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    RouterModule.forRoot(routes),
    MaterializeModule
  ],
  providers: [ConfigService,{provide: LocationStrategy,useClass: HashLocationStrategy},CookieService],
  bootstrap: [AppComponent]
})
export class AppModule { }
